package com.gxa.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author CodingPang
 * @version V1.0
 * @description 错误类型枚举
 * @date 2022/09/08 19:16
 * @since 1.0
 */
@Getter
public enum  ErrorType {
    /***
     * 1. 以下错误码的定义，需要提前与前端沟通
     * 2. 错误码按模块进行错误码规划
     * 3. 所有错误码枚举类均需要实现错误码接口类
     */
    SUCCESS(0,"success"),
    SYSTEM_BUSY(10000,"系统繁忙,请稍后再试!"),
    FORM_VALIDATION_ERROR(10001,"表单验证错误"),
    // 用户登录方面错误码
    LOGIN_ERROR(101001, "你还未登陆,请及时登陆"),
    TOKEN_ERROR(101002, "登录凭证已过期，请重新登录"),

    /********************** 基础异常码 **********************/
    EMPTY_PARAMETERS(10001, "参数为空，请校验参数"),

    CHECK_EMPTY_PARAMETERS(10002,"请检查查询条件，姓名、身份证号以及电话号,参数为空"),

    CHECK_PHONE(10003,"请输入正确格式手机号"),

    CHECK_DOCUMENTNO(10004,"请输入正确格式的身份证号码"),

    CHECK_NAME(10005,"请输入正确格式的姓名"),

    CHECK_TIMESTAMP(10006,"请输入时间戳"),

    CHECK_UMNAME(10007,"请输入UM帐号"),

    EMPTY_NAME_PHONE(10008,"请检查查询条件，姓名,身份证号为空"),

    EMPTY_QUERYTYPE(10009, "请设置查询类型"),

    EMPTY_QUERYREASONCODE(10010, "请设置查询原因码值"),

    EMPTY_QUERY_WAY(10011, "请设置查询方式"),

    EMPTY_CHANNEL_NAME(10012, "请设置渠道名称"),

    EMPTY_QUERY_REASON(10013, "无此查询原因"),

    EMPTY_QUERY_PAGE(10014, "分页查询参数不能为空"),

    /********************** 业务异常 **********************/
    FAILED_UPLOAD_UDMP(20001,"云平台服务失效"),

    FAILED_CREATE_PDF(20002,"生成PDF失败"),

    FAILED_UPLOAD_IM(20003,"上传至影像库失败"),

    IDENTITY_NOT_MATCH(20004,"身份不匹配"),

    NOT_FOUND_PDF(20005,"无对应文档ID的PDF文件或文档已过期,请重新根据姓名身份证号进行查询"),

    FAILED_SAVE_PY_RESULT(20006,"结果保存失败"),

    /********************** 鹏元服务商接口不可用 **********************/
    PY_SYS_ERROR(30001,"服务不可用"),

    PY_SYS_TIMEOUT(30002,"服务超时"),

    /********************** 系统异常 **********************/
    SYSTEM_ERROR(50000,"接口未知异常");


    private Integer code;
    private String msg;

    ErrorType(Integer code, String text) {
        this.code = code;
        this.msg = text;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}